package com.bbva.generico.dao;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.bbva.generico.to.GnrSistema;
import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class GnrSistemaDAOImpl extends SqlMapClientDaoSupport implements GnrSistemaDAO {

	private static final Logger log = Logger.getLogger(GnrSistemaDAOImpl.class);
    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ADAC00.TGNR_SISTEMA
     *
     * @ibatorgenerated Tue Jun 11 17:01:33 COT 2013
     */
	@Autowired
    public GnrSistemaDAOImpl(SqlMapClient sqlMapClient) {
    	setSqlMapClient(sqlMapClient);
    }

	public GnrSistemaDAOImpl() {
		super();
	}
    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ADAC00.TGNR_SISTEMA
     *
     * @ibatorgenerated Tue Jun 11 17:01:33 COT 2013
     */
    public int deleteByPrimaryKey(BigDecimal idSistema) {
        GnrSistema key = new GnrSistema();
        key.setIdSistema(idSistema);
        int rows = getSqlMapClientTemplate().delete("ADAC00_TGNR_SISTEMA.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ADAC00.TGNR_SISTEMA
     *
     * @ibatorgenerated Tue Jun 11 17:01:33 COT 2013
     */
    public void insert(GnrSistema record) {
        getSqlMapClientTemplate().insert("ADAC00_TGNR_SISTEMA.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ADAC00.TGNR_SISTEMA
     *
     * @ibatorgenerated Tue Jun 11 17:01:33 COT 2013
     */
    public void insertSelective(GnrSistema record) {
        getSqlMapClientTemplate().insert("ADAC00_TGNR_SISTEMA.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ADAC00.TGNR_SISTEMA
     *
     * @ibatorgenerated Tue Jun 11 17:01:33 COT 2013
     */
    public GnrSistema selectByPrimaryKey(BigDecimal idSistema) {
        GnrSistema key = new GnrSistema();
        key.setIdSistema(idSistema);
        log.info("---> selectByPrimaryKey, idsistema = " + idSistema);
        GnrSistema record = (GnrSistema) getSqlMapClientTemplate().queryForObject("ADAC00_TGNR_SISTEMA.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ADAC00.TGNR_SISTEMA
     *
     * @ibatorgenerated Tue Jun 11 17:01:33 COT 2013
     */
    public int updateByPrimaryKeySelective(GnrSistema record) {
        int rows = getSqlMapClientTemplate().update("ADAC00_TGNR_SISTEMA.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ADAC00.TGNR_SISTEMA
     *
     * @ibatorgenerated Tue Jun 11 17:01:33 COT 2013
     */
    public int updateByPrimaryKeyWithBLOBs(GnrSistema record) {
        int rows = getSqlMapClientTemplate().update("ADAC00_TGNR_SISTEMA.ibatorgenerated_updateByPrimaryKeyWithBLOBs", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ADAC00.TGNR_SISTEMA
     *
     * @ibatorgenerated Tue Jun 11 17:01:33 COT 2013
     */
    public int updateByPrimaryKeyWithoutBLOBs(GnrSistema record) {
        int rows = getSqlMapClientTemplate().update("ADAC00_TGNR_SISTEMA.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

	@Override
	public List<GnrSistema> selectByLstAplicaciones(GnrSistema lista) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("codAplicacion", lista.getCodigo());
		return null;
	}
}